#   Name: CMakeLists.txt
#   Createed by: Le Manh Thang
#   Date: 10/03/2020
#   


cmake_minimum_required (VERSION 3.0)

enable_language(C)
enable_language(CXX)

project (demo)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

#add share libray opencv
set( OpenCV_DIR libopencv_world.so)
link_directories(/media/thanglmb/DATA/myProject/AI_DL/libOpenCV/lib)
include_directories(/media/thanglmb/DATA/myProject/AI_DL/libOpenCV/include/opencv4)

# add opencv /usr/local/lib
#find_package ( OpenCV REQUIRED)
#include_directories( ${OpenCV_INCLUDE_DIRS})


# call lib darknet
set (DARKNET_LIB libdarknet.a)
link_directories( ${CMAKE_SOURCE_DIR}/darknet/build)
include_directories(${CMAKE_SOURCE_DIR}/darknet/include)

#call lib ncnn
set (NCNN_LIB libncnn.a)
link_directories( ${CMAKE_SOURCE_DIR}/libncnn/lib)
include_directories(${CMAKE_SOURCE_DIR}/libncnn/include/ncnn)

#call lib darknet2ncnn
set (DARKNET2NCNN_LIB libdarknet2ncnn.a)
link_directories( ${CMAKE_SOURCE_DIR}/darknet2ncnn/build)
include_directories(${CMAKE_SOURCE_DIR}/darknet2ncnn/include)
include_directories(${CMAKE_SOURCE_DIR}/darknet2ncnn/src)


file(GLOB SOURCES demo/*.cpp)
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries( ${PROJECT_NAME} ${OpenCV_DIR} ${DARKNET_LIB} ${NCNN_LIB} ${DARKNET2NCNN_LIB} -fopenmp -Wall -lm -lpthread -lstdc++ -std=c++11)


